﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text;

namespace DigitalAmele.WebApp.Tools.MessageBox
{
    public class BoxButton
    {
        public string ClassName { get; set; }
        public string Text { get; set; }
        public bool HasAction { get; set; }
        public string Action { get; set; }

        public string create_button()
        {
            StringBuilder boxHtml = new StringBuilder();

            boxHtml.Append("'" + Text + "': {");
            boxHtml.Append("'class': '" + ClassName + "'");
            if (HasAction)
            {
                boxHtml.Append(",");
                boxHtml.Append("'action': function() { " + Action + " }");
            }
            boxHtml.Append("}");

            return boxHtml.ToString();
        }
    }
}